﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarInfoBusiness
{
    public class CalcProgressBar
    {
        private static CalcProgressBar cpb;

        private CalcProgressBar()
        { }

        public static CalcProgressBar Instance
        {
            get
            {
                if (cpb == null)
                    cpb = new CalcProgressBar();
                return cpb;
            }
        }

        private double NumOfBrandsPlusOne;

        public double GetBrandsFinished(int NumOfBrands)
        {
            this.NumOfBrandsPlusOne = NumOfBrands + 1;
            return (1.0 / (double)(NumOfBrands + 1)) * 100.0;
        }

        public double GetTypeFinished(double OrderOfType, double NumOfTypes, double OrderOfBrand)
        {
            return ((1.0 / NumOfBrandsPlusOne) * (OrderOfType / NumOfTypes) + (OrderOfBrand / NumOfBrandsPlusOne)) * 100.0;
        }

        public double GetCarFinished()
        {
            return 0.0;
        }
    }
}
